Integrand size = 26, antiderivative size = 219 \[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=\frac {2 b^4 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2} d}+\frac {2 b^2 \left (3 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2} d}-\frac {\sin (c+d x)}{2 (a+b)^2 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{2 (a-b)^2 d (1+\cos (c+d x))}-\frac {b^3 \sin (c+d x)}{\left (a^2-b^2\right )^2 d (b+a \cos (c+d x))} \]
[Out]
Time = 0.48 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.269, Rules used = {4482, 2976, 2727, 2738, 214, 2743, 12} \[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=\frac {2 b^2 \left (3 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d (a-b)^{5/2} (a+b)^{5/2}}-\frac {b^3 \sin (c+d x)}{d \left (a^2-b^2\right )^2 (a \cos (c+d x)+b)}+\frac {2 b^4 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d (a-b)^{5/2} (a+b)^{5/2}}-\frac {\sin (c+d x)}{2 d (a+b)^2 (1-\cos (c+d x))}-\frac {\sin (c+d x)}{2 d (a-b)^2 (\cos (c+d x)+1)} \]
[In]
[Out]
Rule 12
Rule 214
Rule 2727
Rule 2738
Rule 2743
Rule 2976
Rule 4482
Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos (c+d x) \cot ^2(c+d x)}{(b+a \cos (c+d x))^2} \, dx \\ & = -\int \left (-\frac {1}{2 (a-b)^2 (-1-\cos (c+d x))}-\frac {1}{2 (a+b)^2 (1-\cos (c+d x))}+\frac {b^2 \left (3 a^2-b^2\right )}{a \left (a^2-b^2\right )^2 (-b-a \cos (c+d x))}-\frac {b^3}{a \left (-a^2+b^2\right ) (b+a \cos (c+d x))^2}\right ) \, dx \\ & = \frac {\int \frac {1}{-1-\cos (c+d x)} \, dx}{2 (a-b)^2}+\frac {\int \frac {1}{1-\cos (c+d x)} \, dx}{2 (a+b)^2}-\frac {b^3 \int \frac {1}{(b+a \cos (c+d x))^2} \, dx}{a \left (a^2-b^2\right )}-\frac {\left (b^2 \left (3 a^2-b^2\right )\right ) \int \frac {1}{-b-a \cos (c+d x)} \, dx}{a \left (a^2-b^2\right )^2} \\ & = -\frac {\sin (c+d x)}{2 (a+b)^2 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{2 (a-b)^2 d (1+\cos (c+d x))}-\frac {b^3 \sin (c+d x)}{\left (a^2-b^2\right )^2 d (b+a \cos (c+d x))}+\frac {b^3 \int \frac {b}{b+a \cos (c+d x)} \, dx}{a \left (a^2-b^2\right )^2}-\frac {\left (2 b^2 \left (3 a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-a-b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2-b^2\right )^2 d} \\ & = \frac {2 b^2 \left (3 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2} d}-\frac {\sin (c+d x)}{2 (a+b)^2 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{2 (a-b)^2 d (1+\cos (c+d x))}-\frac {b^3 \sin (c+d x)}{\left (a^2-b^2\right )^2 d (b+a \cos (c+d x))}+\frac {b^4 \int \frac {1}{b+a \cos (c+d x)} \, dx}{a \left (a^2-b^2\right )^2} \\ & = \frac {2 b^2 \left (3 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2} d}-\frac {\sin (c+d x)}{2 (a+b)^2 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{2 (a-b)^2 d (1+\cos (c+d x))}-\frac {b^3 \sin (c+d x)}{\left (a^2-b^2\right )^2 d (b+a \cos (c+d x))}+\frac {\left (2 b^4\right ) \text {Subst}\left (\int \frac {1}{a+b+(-a+b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2-b^2\right )^2 d} \\ & = \frac {2 b^4 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2} d}+\frac {2 b^2 \left (3 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2} d}-\frac {\sin (c+d x)}{2 (a+b)^2 d (1-\cos (c+d x))}-\frac {\sin (c+d x)}{2 (a-b)^2 d (1+\cos (c+d x))}-\frac {b^3 \sin (c+d x)}{\left (a^2-b^2\right )^2 d (b+a \cos (c+d x))} \\ \end{align*}
Time = 1.83 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.60 \[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=\frac {-\frac {12 a b^2 \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+\frac {\left (-3 b^3-2 a \left (a^2-b^2\right ) \cos (c+d x)+\left (2 a^2 b+b^3\right ) \cos (2 (c+d x))\right ) \csc (c+d x)}{b+a \cos (c+d x)}}{2 (a-b)^2 (a+b)^2 d} \]
[In]
[Out]
Time = 1.37 (sec) , antiderivative size = 155, normalized size of antiderivative = 0.71
method | result | size |
derivativedivides | \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a^{2}-2 a b +b^{2}\right )}-\frac {1}{2 \left (a +b \right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {2 b^{2} \left (-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {3 a \,\operatorname {arctanh}\left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2}}}{d}\) | \(155\) |
default | \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a^{2}-2 a b +b^{2}\right )}-\frac {1}{2 \left (a +b \right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {2 b^{2} \left (-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b}-\frac {3 a \,\operatorname {arctanh}\left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2}}}{d}\) | \(155\) |
risch | \(-\frac {2 i \left (a^{4} {\mathrm e}^{3 i \left (d x +c \right )}+a^{2} b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+b^{4} {\mathrm e}^{3 i \left (d x +c \right )}+3 a \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+a^{4} {\mathrm e}^{i \left (d x +c \right )}-3 a^{2} b^{2} {\mathrm e}^{i \left (d x +c \right )}-b^{4} {\mathrm e}^{i \left (d x +c \right )}-2 a^{3} b -a \,b^{3}\right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )} a +2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right ) \left (a^{2}-b^{2}\right )^{2} a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) d}+\frac {3 b^{2} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}-\frac {3 b^{2} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}\) | \(346\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 518, normalized size of antiderivative = 2.37 \[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=\left [-\frac {2 \, a^{4} b + 2 \, a^{2} b^{3} - 4 \, b^{5} - 3 \, {\left (a^{2} b^{2} \cos \left (d x + c\right ) + a b^{3}\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) \sin \left (d x + c\right ) - 2 \, {\left (2 \, a^{4} b - a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )}{2 \, {\left ({\left (a^{7} - 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} - a b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} d\right )} \sin \left (d x + c\right )}, -\frac {a^{4} b + a^{2} b^{3} - 2 \, b^{5} - 3 \, {\left (a^{2} b^{2} \cos \left (d x + c\right ) + a b^{3}\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - {\left (2 \, a^{4} b - a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )}{{\left ({\left (a^{7} - 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} - a b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} d\right )} \sin \left (d x + c\right )}\right ] \]
[In]
[Out]
\[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=\int \frac {\cos {\left (c + d x \right )}}{\left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right )^{2}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.54 (sec) , antiderivative size = 282, normalized size of antiderivative = 1.29 \[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=-\frac {\frac {12 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a b^{2}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {-a^{2} + b^{2}}} + \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2} - 2 \, a b + b^{2}} + \frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 5 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{3} + a^{2} b + a b^{2} - b^{3}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}}{2 \, d} \]
[In]
[Out]
Time = 23.40 (sec) , antiderivative size = 213, normalized size of antiderivative = 0.97 \[ \int \frac {\cos (c+d x)}{(a \sin (c+d x)+b \tan (c+d x))^2} \, dx=\frac {\frac {a^2-2\,a\,b+b^2}{a+b}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^3-3\,a^2\,b+3\,a\,b^2-5\,b^3\right )}{{\left (a+b\right )}^2}}{d\,\left (\left (2\,a^3-6\,a^2\,b+6\,a\,b^2-2\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (-2\,a^3+2\,a^2\,b+2\,a\,b^2-2\,b^3\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d\,{\left (a-b\right )}^2}+\frac {6\,a\,b^2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}{{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{3/2}}\right )}{d\,{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}} \]
[In]
[Out]